package com.itheima.stream;

import java.util.ArrayList;
import java.util.Set;
import java.util.stream.Collectors;

public class StreamDemo05 {
    public static void main(String[] args) {
        ArrayList<Integer> list=new ArrayList<>();
        for (int i = 1; i <=10; i++) {
            list.add(i);
        }
        list.add(10);
        list.add(10);
        list.add(10);
        list.add(10);
        Set<Integer> set = list.stream().filter(number -> number % 2 == 0).collect(Collectors.toSet());
        System.out.println(set);
        System.out.println(list.stream().filter(number -> number % 2 == 0).collect(Collectors.toList()));
    }
}
